#include "e2d/yml/render/Serializer.h"

using Serializer = e2d::BasicSerializer;

template<>
void Serializer::Encode<e2d::LightEnv>(YAML::Node& node, const e2d::LightEnv& inst)
{
	Encode<e2d::Object>(node, inst);
	SetVariable<e2d::IrradianceTextureMap>(node ,"m_IrradianceMap", inst.m_IrradianceMap);
	SetVariable<e2d::PrefilterTextureMap >(node, "m_PrefilterMap", inst.m_PrefilterMap);
	SetVariable<e2d::BrdfTextureMap>(node, "m_brdfLUTMap", inst.m_brdfLUTMap);

}


template<>
bool Serializer::Decode<e2d::LightEnv>(const YAML::Node& node, e2d::LightEnv& inst)
{
	Decode<e2d::Object>(node, inst);
	GetVariable<e2d::IrradianceTextureMap>(node, "m_IrradianceMap", inst.m_IrradianceMap);
	GetVariable<e2d::PrefilterTextureMap >(node, "m_PrefilterMap", inst.m_PrefilterMap);
	GetVariable<e2d::BrdfTextureMap>(node, "m_brdfLUTMap", inst.m_brdfLUTMap);
	return true;
}
